package com.sgb.link.utils;

import com.swgk.core.util.StringUtil;

/**
 * Time:2021/5/20
 * AUTHOR:F_Q
 * Description: 根据单位比对数据
 */
public class UnitListUtils {
    private static String[] unit = new String[]{"升", "吨", "千克", "米", "立方米", "平方米"};

    public static boolean getUnitStart(String unitName) {
        if (StringUtil.isEmpty(unitName)) {
            return false;
        }
        for (String s : unit) {
            if (unitName.equals(s)) {
                return true;
            }
        }
        return false;
    }


    /**
     * 判断字符串是否是整数
     */
    public static boolean isInteger(String value) {
        try {
            Integer.parseInt(value);
            return true;
        } catch (NumberFormatException e) {
            return false;
        }
    }
}
